﻿using System;
using System.Threading;
using System.Windows.Forms;
using GM.Forms;

namespace GM
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            var instanceCountOne = false;

            using (var mutex = new Mutex(true, "GM", out  instanceCountOne))
            {
                if (instanceCountOne)
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    Application.Run(new MainForm());
                    mutex.ReleaseMutex();
                }
                else
                {
                    MessageBox.Show("Można uruchomić tylko jeden egzemplarz aplikacji.", "Ostrzeżenie",
                                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
        }
    }
}
